package com.ttdc.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.ttdc.pojo.Role;
import com.ttdc.service.RoleService;


@Controller
//@RestController
public class IndexController {

	@Autowired
	private RoleService roleService;
	//跳转到首页页面
	@RequestMapping(value = "/index")
	public String index() {
		return "index";
	}

	//跳转到注册页面
	@RequestMapping(value = "/re")
	public String register() {
		return "register";
	}
	//跳转到dc页面
	@RequestMapping(value = "/dc")
	public String dc() {
		return "dc";
	}

	
	//跳转到餐桌页面
	@RequestMapping(value = "/admin/table")
	public String table() {
		return "/admin/table";
	}
	
	//跳转到前台餐桌页面
	@RequestMapping(value = "/qtable")
	public String qtable() {
		return "qtable";
	}
	
	
	//跳转到菜品页面
	@RequestMapping(value = "/dishes/Dishestest")
	public String Dishestest() {
		return "/dishes/Dishestest";
	}
	//跳转到菜品查询页面
	@RequestMapping(value = "/dishes/Dishesselect")
	public String Dishesselect() {
		return "/dishes/Dishesselect";
	}
	
	//跳转到订单查询页面
	@RequestMapping(value = "/orderlist/olselect")
	public String olselect() {
		return "/orderlist/olselect";
	}
	
	
	//跳转到订单页面
	@RequestMapping(value = "/orderlist/oltest")
	public String oltest() {
		return "/orderlist/oltest";
	}
	//跳转到订单详情页面
	@RequestMapping(value = "/Odtest")
	public String Odtest() {
		return "/Odtest";
	}
	
	
	//跳转到cx查询页面
		@RequestMapping(value = "/admin/selectCuisine")
		public String selectCuisine() {
			return "admin/selectCuisine";
		}
	
	//跳转到cx页面
	@RequestMapping(value = "/admin/cuisine")
	public String cuisine() {
		return "/admin/cuisine";
	}
	//跳转到admin页面
	@RequestMapping(value = "/admin/admin")
	public String admin() {
		return "/admin/admin";
	}
	

	// 跳转到登录页面

	@RequestMapping(value = "/signin")
	public String signin(Model model) {
		List<Role> list=roleService.selectAllRole();
		model.addAttribute("roleList",list);
		return "/login";
	}
}